package com.metacube.questionbank.controller;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.metacube.questionbank.dto.QuestionDTO;
import com.metacube.questionbank.service.Utility;

@Controller
@RequestMapping("/get")
public class RecentQuestionsController {

	@Autowired
	Utility utility;
	
	@RequestMapping(value = "/getRecentQuestions")
	@ResponseBody
	public List<QuestionDTO> getRecentQuestions() {

		List<QuestionDTO> qList = utility.getRecentQuestions();
		System.out.println("hello");
		System.out.println(qList.get(0).getqTitle());
		return qList;
	}
}
